package com.example.wxback.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.wxback.util.constants.Constants;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@TableName("tb_activation_code")
public class ActivationCodePo {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    private String code;

    private String phone;

    private Integer type;// 1-1天 2-1个月 3-1年

    @TableId(value = "create_time")
    @JsonFormat(pattern = Constants.DATETIME_FORMAT, timezone = "GMT+8")
    private Date createTime;

    @TableId(value = "update_time")
    @DateTimeFormat(pattern = Constants.DATETIME_FORMAT)
    private Date updateTime;

    @TableId(value = "active_time")
    @JsonFormat(pattern = Constants.DATETIME_FORMAT, timezone = "GMT+8")
    private Date activeTime;

    @TableId(value = "expiration_time")
    @JSONField(format = Constants.DATETIME_FORMAT)
    private Date expirationTime;
}
